<template>
	<router-link to="/personal/news">
		<div class="inform">
			<span class="hint bg-subject circle" v-if="data.new_msg !=0 "></span>
			<img class="responsive-img" :src="img"alt="">
		</div>
	</router-link>
</template>
<script>
	export default{
		name: 'Inform',
		props:{
			img:{
				type : String
			},
		},
		data(){ 
			return{
				data : [],
			}
		},
		created()
		{
			this.loadData();
		},
		methods:
		{
			loadData()
			{
				this.$http.get('/user/personal',{ params : { type : 1}}).then( res => {
					this.data = res.data;
				})
			}
		}
	}
</script>

<style lang="less">
	.inform{
		color: #fff;
		position:relative;
		width: 20px;
		height: 20px;
		.hint{
			text-align:center;
			width: 8px;
			height: 8px;
			position: absolute;
			top: -3px;
			right: -3px;
		}
		i{
			font-size: 52/28rem;
		}
	}
</style>